import random

number=random.randint(0,100)
print(number)

for i in range(10):
    user_nunber=int(input('请输入一个数字：'))
    if user_nunber>number:
        print('大了')
        print(f'还有{10-i-1}次机会')
    elif user_nunber<number:
        print('小了')
        print(f'还有{10-i-1}次机会')
    else:
        print('猜对了')
        print(f'用了{i+1}次机会')
        break
else:
    print('游戏结束，你没有猜到')

